﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/AdminPage.master" AutoEventWireup="true" CodeFile="Mail_Details.aspx.cs" Inherits="Admin_Mail_Details" %>

<%@ Register assembly="BasicFrame.WebControls.BasicDatePicker" namespace="BasicFrame.WebControls" tagprefix="BDP" %>

<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1">
    <div id="head">
        <strong>
    <asp:Label ID="Label1" runat="server" Font-Bold="True" ForeColor="White" 
        Text="Mail Details"></asp:Label>
        </strong>
    </div>

    <table style="width: 100%">
        <tr>
            <td class="style4" style="width: 99px">
                &nbsp;</td>
            <td style="width: 192px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                <strong>Mail ID</strong></td>
            <td style="width: 192px">
                <strong>
                <asp:Label ID="lbMailID" runat="server"></asp:Label>
                </strong>
            </td>
            <td style="width: 106px; font-weight: bold">
                <strong>Branch receive</strong></td>
            <td>
                <asp:DropDownList ID="ddlBranch" runat="server" DataSourceID="SqlDataSource2" 
                    DataTextField="BranchName" DataValueField="BranchID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    SelectCommand="SELECT * FROM [Branch]"></asp:SqlDataSource>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                <strong>Sender Name</strong></td>
            <td style="width: 192px">
                <strong>
                <asp:TextBox ID="txtSName" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                    ControlToValidate="txtSName" 
                    ErrorMessage="You did not enter a valid sender name" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Update">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                    ControlToValidate="txtSName" 
                    ErrorMessage="You did not enter a valid sender name" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[A-Z]{1}[a-zA-Z ]{4,45}" 
                    ValidationGroup="Update">*</asp:RegularExpressionValidator>
                </strong>
            </td>
            <td style="width: 106px; font-weight: bold">
                <strong>Receiver Name</strong></td>
            <td>
                <strong>
                <asp:TextBox ID="txtRName" runat="server" Width="150px" MaxLength="50"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                    ControlToValidate="txtRName" 
                    ErrorMessage="You did not enter a valid receiver name" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Update">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" 
                    ControlToValidate="txtRName" 
                    ErrorMessage="You did not enter a valid receiver name" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[A-Z]{1}[a-zA-Z ]{4,45}" 
                    ValidationGroup="Update">*</asp:RegularExpressionValidator>
                </strong>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                &nbsp;</td>
            <td style="width: 192px">
                <asp:Label ID="Label2" runat="server" Font-Size="X-Small" 
                    Text="Sender name need 5 characters. "></asp:Label>
            </td>
            <td style="width: 106px; font-weight: bold">
                &nbsp;</td>
            <td>
                <asp:Label ID="Label3" runat="server" Font-Size="Small" 
                    style="font-size: x-small" Text="Receiver name need 5 characters. "></asp:Label>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                <strong>Sender Address</strong></td>
            <td class="style9" style="width: 189px" valign="top">
                <strong>
                <asp:TextBox ID="txtSAddress" runat="server" Rows="4" TextMode="MultiLine" 
                    Width="150px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                    ControlToValidate="txtSAddress" 
                    ErrorMessage="You did not enter a valid sender address" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Update">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" 
                    ControlToValidate="txtSAddress" 
                    ErrorMessage="You did not enter a valid sender address" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[a-zA-Z0-9\s\,\''\-\.]*" 
                    ValidationGroup="Update">*</asp:RegularExpressionValidator>
                </strong>
            </td>
            <td style="width: 106px; font-weight: bold" valign="top">
                <strong>Receiver Address</strong></td>
            <td valign="top">
                <strong>
                <asp:TextBox ID="txtRAddress" runat="server" Rows="4" TextMode="MultiLine" 
                    Width="150px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                    ControlToValidate="txtRAddress" 
                    ErrorMessage="You did not enter a valid receiver address" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Update">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" 
                    ControlToValidate="txtRAddress" 
                    ErrorMessage="You did not enter a valid receiver address" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[a-zA-Z0-9\s\,\''\-\.]*" 
                    ValidationGroup="Update">*</asp:RegularExpressionValidator>
                </strong>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                <strong>Sender Phone</strong></td>
            <td class="style9" style="width: 189px">
                <strong>
                <asp:TextBox ID="txtSPhone" runat="server" Width="150px" MaxLength="20"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                    ControlToValidate="txtSPhone" 
                    ErrorMessage="You did not enter a valid sender phone" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Update">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                    ControlToValidate="txtSPhone" 
                    ErrorMessage="You did not enter a valid sender phone" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[0-9]{1}[0-9]{6,19}" 
                    ValidationGroup="Update">*</asp:RegularExpressionValidator>
                </strong></td>
            <td style="width: 106px">
                <strong>Receiver Phone</strong></td>
            <td>
                <strong>
                <asp:TextBox ID="txtRPhone" runat="server" Width="150px" MaxLength="20"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                    ControlToValidate="txtRPhone" 
                    ErrorMessage="You did not enter a valid receiver phone" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Update">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" 
                    ControlToValidate="txtRPhone" 
                    ErrorMessage="You did not enter a valid receiver phone" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="[0-9]{1}[0-9]{6,19}" 
                    ValidationGroup="Update">*</asp:RegularExpressionValidator>
                </strong></td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                &nbsp;</td>
            <td class="style9" style="width: 189px">
                <asp:Label ID="Label4" runat="server" Font-Size="X-Small" 
                    Text="Include 7 digits for phone number"></asp:Label>
            </td>
            <td style="width: 106px">
                &nbsp;</td>
            <td>
                <asp:Label ID="Label5" runat="server" Font-Size="X-Small" 
                    Text="Include 7 digits for phone number"></asp:Label>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                <strong>Sender Email</strong></td>
            <td class="style9" style="width: 189px">
                <strong>
                <asp:TextBox ID="txtSEmail" runat="server" Width="150px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                    ControlToValidate="txtSEmail" 
                    ErrorMessage="You did not enter a valid sender email" ForeColor="Red" 
                    SetFocusOnError="True" ValidationGroup="Update">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" 
                    ControlToValidate="txtSEmail" 
                    ErrorMessage="You did not enter a valid sender email" ForeColor="Red" 
                    SetFocusOnError="True" 
                    ValidationExpression="[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+.[a-zA-Z0-9-.]+" 
                    ValidationGroup="Update">*</asp:RegularExpressionValidator>
                </strong></td>
            <td style="width: 106px">
                <strong>Recevier ZipCode</strong></td>
            <td>
                <strong>
                <asp:TextBox ID="txtZipCode" runat="server" Width="150px" MaxLength="20"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                    ControlToValidate="txtZipCode" ErrorMessage="You did not enter a valid ZipCode" 
                    ForeColor="Red" SetFocusOnError="True" ValidationGroup="Update">*</asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="RegularExpressionValidator8" runat="server" 
                    ControlToValidate="txtZipCode" 
                    ErrorMessage="You did not enter a valid Zip Code" ForeColor="Red" 
                    SetFocusOnError="True" ValidationExpression="\d{5}([\-]\d{4})?" 
                    ValidationGroup="Update">*</asp:RegularExpressionValidator>
                <asp:HyperLink ID="HyperLink1" runat="server" Font-Underline="True" 
                    ForeColor="Blue">Find ZipCode</asp:HyperLink>
                </strong></td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                <strong>Type of mail</strong></td>
            <td style="width: 192px">
                <strong>
                <asp:DropDownList ID="ddlTOMail" runat="server" DataSourceID="SqlDataSource3" 
                    DataTextField="MTypeName" DataValueField="MTypeID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    SelectCommand="SELECT * FROM [TypeofMail]"></asp:SqlDataSource>
                </strong>
            </td>
            <td style="width: 106px">
                <strong>Type of deliver</strong></td>
            <td>
                <strong>
                <asp:DropDownList ID="ddlTODeliver" runat="server" DataSourceID="SqlDataSource5" 
                    DataTextField="DTypeName" DataValueField="DTypeID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource5" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    SelectCommand="SELECT * FROM [TypeofDeliver]"></asp:SqlDataSource>
                </strong>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                <strong>Distance of mail</strong></td>
            <td style="width: 192px">
                <strong>
                <asp:DropDownList ID="ddlDOMail" runat="server" DataSourceID="SqlDataSource4" 
                    DataTextField="Distance" DataValueField="DistanceID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource4" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    SelectCommand="SELECT * FROM [DistanceofMail]"></asp:SqlDataSource>
                </strong>
            </td>
            <td style="width: 106px">
                <strong>Weight of mail</strong></td>
            <td>
                <strong>
                <asp:DropDownList ID="ddlWOMail" runat="server" DataSourceID="SqlDataSource6" 
                    DataTextField="Weight" DataValueField="WeightID">
                </asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSource6" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:OPOConnectionString %>" 
                    SelectCommand="SELECT * FROM [WeightofMail]" 
                    DeleteCommand="DELETE FROM [WeightofMail] WHERE [WeightID] = @WeightID" 
                    InsertCommand="INSERT INTO [WeightofMail] ([Weight], [WeightCharge]) VALUES (@Weight, @WeightCharge)" 
                    UpdateCommand="UPDATE [WeightofMail] SET [Weight] = @Weight, [WeightCharge] = @WeightCharge WHERE [WeightID] = @WeightID">
                    <DeleteParameters>
                        <asp:Parameter Name="WeightID" Type="Int32" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="Weight" Type="String" />
                        <asp:Parameter Name="WeightCharge" Type="String" />
                    </InsertParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="Weight" Type="String" />
                        <asp:Parameter Name="WeightCharge" Type="String" />
                        <asp:Parameter Name="WeightID" Type="Int32" />
                    </UpdateParameters>
                </asp:SqlDataSource>
                </strong>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                <strong>Date Receipt</strong></td>
            <td style="width: 192px">
                <BDP:BasicDatePicker ID="bdpDateReceipt" runat="server" 
                    DateFormat="MM/dd/yyyy" DisplayType="TextBox" />
                </td>
            <td style="width: 106px">
                <strong>Status</strong></td>
            <td>
                <strong>
                <asp:DropDownList ID="ddlStatus" runat="server">
                    <asp:ListItem>Pending</asp:ListItem>
                    <asp:ListItem>Received</asp:ListItem>
                </asp:DropDownList>
                </strong>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                <strong>Date Delivery</strong></td>
            <td style="width: 192px">
                <BDP:BasicDatePicker ID="bdpDateDelivery" runat="server" 
                    DateFormat="MM/dd/yyyy" />
                <BDP:DateCompareValidator ID="DateCompareValidator1" runat="server" 
                    ControlToCompare="bdpDateReceipt" ControlToValidate="bdpDateDelivery" 
                    ErrorMessage="You did not enter a valid date delivery" ForeColor="Red" 
                    Operator="GreaterThanEqual" SetFocusOnError="True" ValidationGroup="Update">*</BDP:DateCompareValidator>
                </td>
            <td style="width: 106px">
                <strong>Send Email</strong></td>
            <td>
                <strong>
                <asp:DropDownList ID="ddlSendEmail" runat="server">
                    <asp:ListItem>No</asp:ListItem>
                    <asp:ListItem>Yes</asp:ListItem>
                </asp:DropDownList>
                <asp:HyperLink ID="HyperLink2" runat="server" Font-Underline="True" 
                    ForeColor="Blue" NavigateUrl="~/Admin/Mail_SendEmail.aspx">Send Email</asp:HyperLink>
                </strong>
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                &nbsp;</td>
            <td style="width: 192px">
                &nbsp;</td>
            <td>
                <strong>Total Fee</strong></td>
            <td>
                <strong>
                <asp:Label ID="lbTotalFee" runat="server"></asp:Label>
                VND</strong></td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                &nbsp;</td>
            <td style="width: 192px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                <asp:ImageButton ID="ImageButton1" runat="server" 
                    ImageUrl="~/images/iconcal.png" onclick="ImageButton1_Click" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                &nbsp;</td>
            <td colspan="3">
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" 
                    ValidationGroup="Update" />
            </td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style3" colspan="5">
                <asp:ImageButton ID="ImageButton2" runat="server" 
                    ImageUrl="~/images/img_Update.png" onclick="ImageButton2_Click" 
                    style="text-align: center" ValidationGroup="Update" />
                <asp:ImageButton ID="ImageButton3" runat="server" 
                    ImageUrl="~/images/img_Back.png" PostBackUrl="~/Admin/Mail_Management.aspx" 
                    style="text-align: center" />
                <asp:ImageButton ID="ImageButton4" runat="server" 
                    ImageUrl="~/images/img_Cancel.png" style="text-align: center" />
            </td>
        </tr>
        <tr>
            <td class="style4" style="width: 99px">
                &nbsp;</td>
            <td style="width: 192px">
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
    </table>
&nbsp;
</asp:Content>


